<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Santas Helper - Addresses - Edit</title>
	</head>
	<body>
		<header>
			<h1>Addresses</h1>
			<h2>Edit address</h2>
		</header>
		<section>
			<form:form modelAttribute="addressBean" commandName="addressData">
				<form:label path="text">Enter new address:</form:label>
				<form:input path="text" />
				<br>
				<c:if test="${not empty addresses}">
					<form:label path="text">Or chose from list:</form:label>
					<form:select path="existingAddressIndex" >
					    <form:option value="-1" label="-- New address --" />
					    <form:options items="${addresses }" itemValue="id" itemLabel="text" />
					</form:select>
				</c:if>			
				<br>
				<br>
				<a href="../../../children/read/${child_id }">Cancel</a>
				<input type="submit" value="Edit">	
			</form:form>
		</section>
		<footer>
			<p>&nbsp;</p>
			<p>&copy; 2012 North Pole Productions</p>
		</footer>
	</body>
</html>